#coding:utf8

from os import getcwd, name as osname
from os.path import exists, isdir, split, splitext
name=splitext(split(__file__)[1])[0].split('_')[-1]
print 'Module Name:', name
if osname=='nt':
	for drive in 'CDEFG':
		for ver in '25 26 27'.split():
			try:
				path_python=(r'%s:\Python'+ver) % drive
				if exists(path_python) and isdir(path_python):
					fp=r'%s\Lib\site-packages\%s.pth' % (path_python, name)
					pwd=getcwd()
					open(fp, 'w').write(pwd)
					print '\nInstalled:\n\t', pwd, '\nIn:\n\t', fp
			except:
				pass
else:
	for prefix in '/usr/lib /usr/local/lib'.split():
		for ver in '2.5 2.6 2.7'.split():
			try:
				packages_dir=(r'%s/python%s/dist-packages') % (prefix, ver)
				if isdir(packages_dir):
					fp='%s/%s.pth' % (packages_dir, name)
					pwd=getcwd()
					open(fp, 'w').write(pwd)
					print '\nInstalled:\n\t', pwd, '\nIn:\n\t', fp
			except:
				pass
				